package dto

import (
	"tuowei.com/app/api/models"
	"tuowei.com/common/dto"
	common "tuowei.com/common/models"
)

type ApiConsultWZGetPageReq struct {
	dto.PaginationNew `search:"-"`
	WZTop             string `json:"wz_top" search:"type:exact;column:wz_top;table:sys_consult_wz" comment:"置顶文章"` // 置顶文章
	Province          string `form:"province" json:"province" search:"type:contains;column:province;table:sys_consult_wz" comment:"适用地区"`
	//WZHot             string `json:"wz_hot" search:"type:exact;column:wz_hot;table:sys_consult_wz" comment:"热门文章"`
}

func (m *ApiConsultWZGetPageReq) GetNeedSearch() interface{} {
	return *m
}

type ApiConsultWZGetReq struct {
	dto.ObjectById
	common.ControlBy
}

func (m *ApiConsultWZGetReq) GetNeedSearch() interface{} {
	return *m
}
func (s *ApiConsultWZGetReq) GetId() interface{} {
	return s.Id
}

type SysConsultWZUpdateReq struct {
	ConsultWZId int `json:"consult_wz_id" comment:"文章ID"` // 文章ID
	common.ControlBy
}

func (s *SysConsultWZUpdateReq) Generate(model *models.SysConsultWZ) {
	if s.ConsultWZId != 0 {
		model.ConsultWZId = s.ConsultWZId
	}
	model.WZReadingNum = model.WZReadingNum + 1
}

func (s *SysConsultWZUpdateReq) GetId() interface{} {
	return s.ConsultWZId
}

type SysConsultWZGetReq struct {
	Id int `uri:"id"`
}

func (s *SysConsultWZGetReq) GetId() interface{} {
	return s.Id
}

type SysConsultWZDeleteReq struct {
	Ids []int `json:"ids"`
}

func (s *SysConsultWZDeleteReq) GetId() interface{} {
	return s.Ids
}

type ApiExercisesGetPageReq struct {
	dto.Pagination `search:"-"`
	Subject        string `form:"subject" json:"subject" search:"type:exact;column:subject;table:sys_exercises" comment:"科目"` // 语文/数学/化学/物理/生物/英语
	PublishRange   string `json:"publish_range" form:"publish_range" search:"type:exact;column:publish_range;table:sys_exercises" comment:"发布范围"`
}

func (m *ApiExercisesGetPageReq) GetNeedSearch() interface{} {
	return *m
}

type ApiCourseBoutiqueGetPageReq struct {
	dto.Pagination `search:"-"`
	Province       string `form:"province" search:"type:contains;column:province;table:sys_course" comment:"适用地区"`
	Status         int    `form:"status" search:"type:exact;column:status;table:sys_course" comment:"状态"` // 状态
}

func (m *ApiCourseBoutiqueGetPageReq) GetNeedSearch() interface{} {
	return *m
}

type ApiIndexSearchReq struct {
	Name     string `json:"name"`
	Province string `json:"province"`
}

func (m *ApiIndexSearchReq) GetNeedSearch() interface{} {
	return *m
}

// ApiAcademyGetPageReq app端獲取推薦院校請求體
type ApiAcademyGetPageReq struct {
	dto.PaginationNew `search:"-"`
	WZTop             string `json:"academy_top" search:"type:exact;column:academy_top;table:sys_academy" comment:"置顶文章"` // 置顶文章
	Province          string `form:"province" json:"province" search:"type:contains;column:province;table:sys_academy" comment:"适用地区"`
}

func (m *ApiAcademyGetPageReq) GetNeedSearch() interface{} {
	return *m
}

type ApiAcademyGetReq struct {
	dto.ObjectById
	common.ControlBy
}
